# -*- coding:UTF-8 -*-
def firstMissingPositive(self, A):
    # write your code here
    if A==None or len(A)==0:
        return 1
    if len(A)==1 and A[0]<=0:
        return 1
    A.sort()
    k=1
    for i in A:
        if i <1:
            continue
        if i==k:
            k+=1
        elif i==k-1:
            continue
        else:
            return k
    return A[len(A)-1]+1

print firstMissingPositive("",[1,-1])
